<?php
namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Model\Agent;

class AgentController extends BaseController
{
    protected $model = null;

    public function __construct(Request $request)
    {
        parent::__construct($request);
        $this->model = new Agent();
    }

    //代理用户列表
    public function agentUserList(Request $request){
        return $this->toJson(self::SUCCESS, $this->model->agentUserList($request));
    }

    //新增代理用户
    public function agentUserAdd(Request $request){
        $res = $this->model->agentUserAdd($request->all());
        return $this->toJson($res['code'], $res['data'], $res['msg']);
    }

    //删除代理用户
    public function agentUserDel(Request $request){
        $res = $this->model->agentUserDel($request->all());
        return $this->toJson($res['code'], $res['data'], $res['msg']);
    }

    //编辑代理用户
    public function agentUserEdit(Request $request){
        $res = $this->model->agentUserEdit($request->all());
        return $this->toJson($res['code'], $res['data'], $res['msg']);
    }

    //代理交易记录列表
    public function agentLogList(Request $request){
        return $this->toJson(self::SUCCESS, $this->model->agentLogList($request));
    }

    //代理钻石交易记录列表
    public function agentDiamondLogList(Request $request){
        return $this->toJson(self::SUCCESS, $this->model->agentDiamondLogList($request));
    }

    //金币代理用户列表
    public function agentGolodUserList(Request $request){
        return $this->toJson(self::SUCCESS, $this->model->agentGolodUserList($request));
    }
    //金币新增代理用户
    public function agentGolodUserAdd(Request $request){
        $res = $this->model->agentGolodUserAdd($request->all());
        return $this->toJson($res['code'], $res['data'], $res['msg']);
    }
    //删除金币代理用户
    public function agentGolodUserDel(Request $request){
        $res = $this->model->agentGolodUserDel($request->all());
        return $this->toJson($res['code'], $res['data'], $res['msg']);
    }
    //编辑金币代理用户
    public function agentGolodUserEdit(Request $request){
        $res = $this->model->agentGolodUserEdit($request->all());
        return $this->toJson($res['code'], $res['data'], $res['msg']);
    }
    //代理交易记录列表
    public function agentGolodLogList(Request $request){
        return $this->toJson(self::SUCCESS, $this->model->agentGolodLogList($request));
    }

    //代理金币交易记录列表
    public function agentGolodKKLogList(Request $request){
        return $this->toJson(self::SUCCESS, $this->model->agentGolodKKLogList($request));
    }
}
